<template>
  <div class="base-info-view">
    <el-form class="form-detail" label-position="right" label-width="110px">
      <el-row :gutter="20" style="width:100%">
        <!--        <el-form-item label="市场准入编号：">-->
        <!--          <div>{{chanceInfo.chanceName}}</div>-->
        <!--        </el-form-item>-->
        <el-col v-if="isAudit" :span="8">
          <el-form-item label="市场准入编号：">
            <div>{{ chanceInfo.chanceNo }}</div>
          </el-form-item>
        </el-col>
        <el-col v-if="isAudit" :span="8">
          <el-form-item label="市场准入名称：">
            <div>{{ chanceInfo.chanceName }}</div>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="准入模式：">
            <div>{{ getLabel('access_mode',chanceInfo.accessMode) }}</div>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="准入地区：">
            <div><area-list-view :areas="chanceInfo.region" /></div>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="适用终端：">
            <div>{{ getLabel('app_mode',chanceInfo.terminalType) }}</div>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="价格属性：">
            <div>{{ getLabel('price_type',String(chanceInfo.priceProperty)) }}</div>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="终端价：">
            <div>{{ chanceInfo.terminalPrice }}元/{{ getLabel('sell_unit',chanceInfo.sellUnit) }}</div>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="产品名称：">
            <div>{{ chanceInfo.productPopularName }}</div>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="商品名：">
            <div>{{ chanceInfo.productName }}</div>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="包装规格：">
            <div>{{ chanceInfo.packSpecs }}</div>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="生产厂家：">
            <div>{{ chanceInfo.producer }}</div>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="结束日期：">
            <div>{{ dateFormat('yyyy-mm-dd',chanceInfo.expireTime) }}</div>
          </el-form-item>
        </el-col>
        <el-col v-if="!isAudit" :span="8">
          <el-form-item label="创建人：">
            <div>{{ chanceInfo.creatorName }}</div>
          </el-form-item>
        </el-col>
        <el-col v-if="!isAudit" :span="8">
          <el-form-item label="创建时间：">
            <div>{{ dateFormat('yyyy-mm-dd HH:MM ',chanceInfo.createdAt) }}</div>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="其他描述：">
            <div v-if="chanceInfo.remark">{{ chanceInfo.remark }}</div>
            <div v-else>暂无</div>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="相关附件：">
            <div v-if="chanceInfo.attachFiles && chanceInfo.attachFiles.length" style="display: flex;justify-content: flex-start;align-items: flex-start;flex-wrap: wrap;">
              <upload-file-view
                      ref="uploadFileView"
                      v-model:fileArr="chanceInfo.attachFiles"
                      :is-upload="false"
              />
<!--              <div v-for="(item,index) in chanceInfo.attachFiles" :key="index" style="margin-right: 20px">-->
<!--                <el-button type="text" @click="handlDownload(item)">-->
<!--                  {{ item.name }}-->
<!--                </el-button>-->
<!--              </div>-->
            </div>
            <div v-else>暂无</div>
          </el-form-item>
        </el-col>
      </el-row>

    </el-form>

  </div>
</template>

<script>
export default {
  name: 'BaseInfo',
  props: {
    chanceInfo: {
      type: Object,
      default: () => {},
    },
    isAudit: {
      type: Boolean,
      default: false
    }
  },
  // setup(props, context) {
  //   var instructionUrl = ref('')
  //   var productUrl = ref('')
  //   return {
  //     instructionUrl,
  //     productUrl,
  //   }
  // },
}
</script>

<style scoped>

</style>
